/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.soa.service.busi.wx;

import com.lianzt.commondata.AbstractCommonData;
import com.soa.exception.GlobalException;
import com.soa.service.BaseService;
import org.springframework.stereotype.Service;

/**
 *  P90004
 * 确认付款
 * @author chang
 */
@Service
public class Qrfsk extends BaseService{

    @Override
    public String[] keys() {
        return null;
    }

    @Override
    public void execute(AbstractCommonData in, AbstractCommonData inhead, AbstractCommonData out, AbstractCommonData outhead) {
        String id = in.getStringValue("id");
        double je = in.getDoubleValue("je");
        String sffq="0";
        AbstractCommonData abs = queryData("get_skxq", new Object[]{id});
        double zj = abs.getDoubleValue("zj");
        double wfk = abs.getDoubleValue("wfk");
        double yfk = abs.getDoubleValue("yfk");
        if(je==wfk){
            sffq="1";
            yfk=yfk+je;
            wfk=wfk-je;
        }else{
            wfk=wfk-je;
            yfk=yfk+je;
        }
        try {
            update("update_qrfk", new Object[]{sffq,wfk,yfk,id});
        } catch (Exception e) {
            throw  new GlobalException(9000401, e);
        }
    }
    
}
